package r21310.chap04.d1110;
 class Demo{
     //多态
     //成员变量 的话编译和运行都看左边
     //成员方法   编译看左边运行看右边
     //弊端 子类不仅而已调用自己的方法




     public static void main(String[] args) {

        show("张三");



     }
     public static void show(String p){

         }
         Teacher t1=new Teacher();

         Student stu=new Student();



     }



abstract class Person {
     String name;

    public void say(){
        System.out.println();
    }
}
class Student extends Person {

    public void say() {
        System.out.println("回答问题");
    }

    public void playGame() {
        System.out.println("玩游戏");
    }
}
class Teacher extends Person{
     public void say(){
         System.out.println("提问问题");
     }
     public void teach(){
         System.out.println("教师在讲课");
     }
}



